﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="MediaDirectories">
    <MediaDirectories>
      <xsl:for-each select="string">
        <MediaDirectory>
          <Path>
            <xsl:value-of select="current()"/>
          </Path>
          <MediaType>Movie</MediaType>
        </MediaDirectory>
      </xsl:for-each>
    </MediaDirectories>
  </xsl:template>

  <xsl:template match="ExcludedDirectories">
    <MediaDirectories>
      <xsl:for-each select="string">
        <MediaDirectory>
          <Path>
            <xsl:value-of select="current()"/>
          </Path>
          <MediaType>Movie</MediaType>
        </MediaDirectory>
      </xsl:for-each>
    </MediaDirectories>
  </xsl:template>

  <xsl:template match="TitleMatchSource" />

  <xsl:template match="TitleMatchOption">
    <TitleMatchingOptions>
      <TitleMatchSource>
        <xsl:value-of select="//TitleMatchSource"/>
      </TitleMatchSource>
      <TitleSortOption>
        <xsl:value-of select="current()"/>
      </TitleSortOption>
      <SortByNewerYear>true</SortByNewerYear>
      <UseYearInPath>true</UseYearInPath>
      <UseYearInParentOnly>false</UseYearInParentOnly>
    </TitleMatchingOptions>
  </xsl:template>

  <xsl:template match="CoverImageOptions">
    <CoverImageOptions>
      <xsl:apply-templates select="@* | node()"/>
      <CoverImageDefaultSize>Original</CoverImageDefaultSize>
      <BackdropImagePreviewSize>Thumb</BackdropImagePreviewSize>
      <BackdropImageDefaultSize>Original</BackdropImageDefaultSize>
    </CoverImageOptions>
  </xsl:template>
</xsl:stylesheet>
